Your effect component must supply information that describes the parameters that your effect takes. This information is used to create an appropriate user interface for setting the parameters to your effect. The parameter description lists your effect's parameters and their data types and indicates the appropriate selection interface for each parameter, such as a slider or a pull-down list, as well as information such as the minimum, maximum, and default values for each parameter. Each parameter is described using a specific format, which is shown in "The Parameter Description Format" .
Your effect component returns its parameter description information through the GetParameterListHandle function. The easiest way to provide this information back to the client software is to add an 'atms' resource to your component. The 'atms' resource contains the parameter descriptions in the required format. You can then retrieve the resource by calling the GetComponentResource function, returning it to the client through your implementation of GetParameterListHandle , as shown in Listing 14 .
Listing 14 Implementing the GetParameterListHandle function using GetComponentResource
pascal ComponentResult GetParameterListHandle(EffectGlobals *glob,
Handle *theHandle)
{
OSErr err = noErr;
err = GetComponentResource((Component) glob->self,
OSTypeConst('atms'),
kEffectatmsRes,
theHandle);
return err;
}
By implementing the GetParameterListHandle function in this way, you can simplify the process of packaging the necessary information in the proper format.
| Previous | Chapter Contents | Chapter Top | Next |